#ifndef _CITYDATALOADCBUS_H_
#define _CITYDATALOADCBUS_H_

#include "DataLoadBase.h"
#include "StringDic.h"
typedef	unsigned int SEEKOFFSET;
class CDataLaodCbus:
	public CDataLoadBase
{
public:
	CDataLaodCbus(void);
	virtual ~CDataLaodCbus(void);

	virtual bool	LoadData();
	virtual bool	SaveData();
	virtual	void	Release();

private:
	
	void			ReadHeader();
	char			ReadChar();
	short			ReadShort();
	SEEKOFFSET		ReadOffset();	
	char*			ReadStr(SEEKOFFSET nPos,char* pszBuff,bool bBack = true);
	char*			ReadStr(char* pszBuff,bool bBack = true);

	inline bool		SetOffset(SEEKOFFSET nPos){
		if(nPos < m_nTotalSize){
			m_nPosOffset = nPos;
			return true;
		}
		return false;
	};
	SEEKOFFSET		GetOffset() const
	{
		return	m_nPosOffset;
	}

private:
	char*			m_pDataBuff;
	SEEKOFFSET		m_nPosOffset;
	SEEKOFFSET		m_nTotalSize;

	CStringDic		m_StrDic;
};	

#endif